package com.dms.modules.product.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dms.modules.product.entity.UserBrowseHistory;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface UserBehaviorMapper extends BaseMapper<UserBrowseHistory> {
    
    List<Map<String, Object>> getRecentBrowsedProducts(@Param("userId") Long userId, @Param("limit") Integer limit);
    
    List<Map<String, Object>> getUserCategoryPreferences(@Param("userId") Long userId);
    
    void insertBrowseHistory(@Param("userId") Long userId, @Param("productId") Long productId, 
                           @Param("categoryId") Long categoryId, @Param("source") String source);
    
    void insertSearchHistory(@Param("userId") Long userId, @Param("keyword") String keyword, 
                           @Param("source") String source);
} 